﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ParticleFiltersDemo1
{
    public class Board
    {
        private Random random = new Random();

        public int[,] board = {{1,1,1,1,1,1,1,1,1,1},
                       {1,0,1,0,0,0,0,0,0,1},
                       {1,0,1,0,0,0,0,0,0,1},
                       {1,0,1,0,0,0,0,0,0,1},
                       {1,0,0,0,0,0,0,0,0,1},
                       {1,0,0,0,1,1,1,0,0,1},
                       {1,0,0,0,1,0,0,0,0,1},
                       {1,0,0,0,0,0,0,0,0,1},
                       {1,0,0,0,0,1,1,0,0,1},
                       {1,1,1,1,1,1,1,1,1,1}};

        public int sizeX = 10;
        public int sizeY = 10;

        public bool IsEmpty( int x, int y )
        {
            return ( board[x, y] == 0 );
        }

        public int[] randomFreeCell()
        {
            int[] res = new int[2];
            do
            {
                res[0] = random.Next( sizeX );
                res[1] = random.Next( sizeY );
            }
            while ( !IsEmpty( res[0], res[1] ) );

            return res;
        }

    }

}
